home *** CD-ROM | disk | FTP | other *** search
- Path: news.infinet.com!cedwards
- From: cedwards@infinet.com (Chad Edwards)
- Newsgroups: comp.lang.c++
- Subject: Re: How do you reset a file?
- Date: 4 Apr 1996 04:15:06 GMT
- Organization: InfiNet
- Message-ID: <4jvica$86n@news1.infinet.com>
- References: <3162b143.399039@news.airmail.net> <4jv1vc$ha1@news.nynexst.com>
- NNTP-Posting-Host: user.infinet.com
- X-Newsreader: TIN [version 1.2 PL2]
-
- Ramesh Nagabushnam (rcn@east) wrote:
- : Elizabeth Cunningham (liz@iadfw.net) wrote:
- : : This might be a stupid question, but I couldn't find the answer in
- : : either of the C++ books I have. How do you reset an fstream object
- : : back to the beginning of the file?
-
- : Your question could be interpreted >= 2 ways
-
- : 1) You just want to move the file pointer:
- :
- : fstream fobj(..);
-
- : fobj.seekpos(0,mode); // see man filebuf
-
- : 2) You wish to truncate the file:
-
- : fstream fobj(..);
-
- : ftruncate(fobj.fd(),0); // see man ftruncate(), man filebuf
-
- : -r
- : ____________________________________________________
- : Ramesh Nagabushnam, (o) (914) 644-2711
- : rcn@nynexst.com (h) (203) 967-1129
-
- --
-
-
- what about the rewind function?
-
-
- ______________________________________________________________________________
- A SIG? What the heck is a Sig? Something you smoke?
- http://www.infinet.com/~cedwards
-
- Home of:
-
- **** **** * *
- * * * * * *
- * * * * * * *
- **** **** * * *****
- Columbus Ohio APBA League
- _______________________________________________________________________________
-
-